Learn R Programming

CompositionalSR (version 1.1)

Spatial k-folds: Spatial k-folds

Description

Spatial k-folds.

Usage

spat.folds(coords, nfolds = 10, size = 1000)

Value

A list with nfolds elements. Each elements contains a list with two elements, the first is the indices of the training set and the second contains the indices of the test set.

Arguments

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

nfolds

The number of spatial folds to create.

size

A numeric value of the specified range by which blocks are created and training/testing data are separated. This distance should be in metres. If you have big regions you should consider increasing this number. For more information see the package blockCV.

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

Folds of data are created based on their coordinates. For more information see the package blockCV.

See Also

cv.alfaslx, me.aslx, gwar, alfa.reg

Examples

Run this code
data(fadn)
coords <- fadn[1:100, 1:2]
folds <- spat.folds(coords, nfolds = 5)

Run the code above in your browser using DataLab